Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
x = border_width + padding.left;
y = border_width + padding.top;
- width = allocation->width - (2 * border_width) -
- padding.left - padding.right;
- height = allocation->height - (2 * border_width) -
- padding.top - padding.bottom;
+ width = allocation->width - (2 * border_width) - padding.left - padding.right;
+ height = allocation->height - (2 * border_width) - padding.top - padding.bottom;
if (menu_shell->priv->active)
gtk_menu_scroll_to (menu, priv->scroll_offset);
if (gtk_widget_get_visible (child))
{
- gint i;
gint l, r, t, b;
get_effective_child_attach (child, &l, &r, &t, &b);
/* Resize the item window */
if (gtk_widget_get_realized (widget))
{
- gint i;
- gint width, height;
+ gint w, h;
- height = 0;
+ h = 0;
for (i = 0; i < gtk_menu_get_n_rows (menu); i++)
- height += priv->heights[i];
+ h += priv->heights[i];
- width = gtk_menu_get_n_columns (menu) * base_width;
- gdk_window_resize (priv->bin_window, width, height);
+ w = gtk_menu_get_n_columns (menu) * base_width;
+ gdk_window_resize (priv->bin_window, w, h);
}
if (priv->tearoff_active)
if (child != NULL && gtk_widget_get_visible (child))
{
- GtkMenuItemPrivate *priv = menu_item->priv;
gint child_min, child_nat;
gtk_widget_get_preferred_width (child, &child_min, &child_nat);
if (subsection)
{
- gboolean could_have_separator;
+ gboolean separator;
- could_have_separator = (section->with_separators && n_items > 0) || subsection->separator_label;
+ separator = (section->with_separators && n_items > 0) || subsection->separator_label;
/* Only pass the parent_model and parent_index in case they may be used to create the separator. */
n_items += gtk_menu_tracker_section_sync_separators (subsection, tracker, offset + n_items,
- could_have_separator,
- could_have_separator ? section->model : NULL,
- could_have_separator ? i : 0);
+ separator,
+ separator ? section->model : NULL,
+ separator ? i : 0);
}
else
n_items++;
if (should_have_separator > section->has_separator)
{
/* Add a separator */
- GtkMenuTrackerItem *item;
+ GtkMenuTrackerItem *separator;
- item = _gtk_menu_tracker_item_new (tracker->observable, parent_model, parent_index, FALSE, NULL, TRUE);
- (* tracker->insert_func) (item, offset, tracker->user_data);
- g_object_unref (item);
+ separator = _gtk_menu_tracker_item_new (tracker->observable, parent_model, parent_index, FALSE, NULL, TRUE);
+ (* tracker->insert_func) (separator, offset, tracker->user_data);
+ g_object_unref (separator);
section->has_separator = TRUE;
}